import java.lang.reflect.Array;
import java.util.Arrays;

public class Sort {
    public static void main(String[] args) {
        int []arr={10,5,8,20,15};
        System.out.println("原始数组："+Arrays.toString(arr));
        Arrays.sort(arr);
        System.out.println("排序后："+Arrays.toString(arr));

        int index = Arrays.binarySearch(arr,15);
        System.out.println("数字15的位置：" + index);

        int Index = Arrays.binarySearch(arr,20);
        System.out.println("数字20的位置："+Index);

        int[] copiedArray = Arrays.copyOf(arr, 7);

        Arrays.fill(copiedArray, 5, 7, -1);

        System.out.println("扩展后的副本：" + Arrays.toString(copiedArray));

        boolean isD = Arrays.equals(arr, copiedArray);
        System.out.println("原数组与扩展后的副本是否相等：" + isD);
    }
}
